﻿
using System;
using System.Drawing;
using MonoTouch.CoreGraphics;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using Beauty.Module.Pos;

namespace Beauty
{
	public partial class MailDailyReportVCtrl : UIViewController
	{
		public MailDailyReportVCtrl () : base ("MailDailyReportVCtrl", null)
		{
		}

		public override void DidReceiveMemoryWarning ()
		{
			// Releases the view if it doesn't have a superview.
			base.DidReceiveMemoryWarning ();
			
			// Release any cached data, images, etc that aren't in use.
		}

		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			lbDay.TextColor = UIColorExtensions.FromHexString ("#007aff");
			btnSave.Layer.CornerRadius = 25.0f;
			btnSave.Layer.ShadowOpacity = 0.0f; 
			btnSave.Layer.BorderWidth = 1.0f;
			btnSave.Layer.BorderColor = UIColorExtensions.FromHexString ("#ff485f").CGColor;
			btnSave.Layer.BackgroundColor = UIColorExtensions.FromHexString ("#ebeef0").CGColor;

			btnClose.SetImage (PosUtility.ImageFrom ("CreateNewJobshetVCtrl_bt_close"), UIControlState.Normal);
			btnClose.TouchUpInside += (object sender, EventArgs e) => {
				closePopup();


			};
			View.Add (btnClose);
			

		}

		void closePopup()
		{
			UIView.AnimateAsync (0.25, animation: () => {
				View.Transform = CGAffineTransform.MakeScale (1.3f, 1.3f);
				View.Alpha = 0f;
			});
		}

		public void showAnimation(){
			View.Transform = CGAffineTransform.MakeScale (1.3f, 1.3f);
			View.Alpha = 0;
			UIView.AnimateAsync (0.25f, animation: () => {
				View.Alpha = 1;
				View.Transform = CGAffineTransform.MakeScale(1,1);
			});
		}
	}
}

